<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<x:parse xml="${param.xmlstr}" var="xmlData" />
<div class="t_bar">
	<span class="color_red">*</span>拟聘请专家情况表
</div>
<table  id="expert_contain" border="0" cellspacing="0" cellpadding="0" class="table01" >
    <col style="width: 20%" />
    <col style="width: 20%" />
    <col style="width: 20%" />
    <col style="width: 20%" />
    <col style="width: 20%" />

    <tr>
        <td align="center">类别</td>
        <td align="center">拟聘请专家人数</td>
        <td align="center">专家来华次数</td>
        <td align="center">申请国拨经费</td>
        <td align="center">单位配套经费</td>
    </tr>
    <tr>

        <td align="center"><x:out select="$xmlData/data/proposal/grant_name" /></td>
        <td align="center">        <input type='text' style="text-align: center;" disabled="disabled" name="proposal/total_num_new" id="yqjfjs" value="<x:out select="$xmlData/data/proposal/total_num_new" />">
        </td>
        <td align="center"><input type='text'  disabled="disabled" name="proposal/total_num_new1" style="text-align: center;" id="yqjfjs1" value="<x:out select="$xmlData/data/proposal/total_num_new1" />"></td>
        <td align="center">
            <input  name="proposal/state_funded_funds" label="申请国拨经费"  style="text-align: right;" type="text"  class="input_css required"
                    onfocus="InitInput.setNumber(this,9,4,2)"
                    value="<x:out select="$xmlData/data/proposal/state_funded_funds" />"/>
            </td>
        <td align="center"> <input  name="proposal/supporting_funds" label="单位配套经费" type="text" style="text-align: right;" class="input_css required "
                                    onfocus="InitInput.setNumber(this,9,4,2)" value="<x:out select="$xmlData/data/proposal/supporting_funds" />"/></td>
    </tr>



</table>


	<table  id="experts" border="0" cellspacing="0" cellpadding="0" class="table01" >
		<thead>
			<tr>
                <th width="10%" >选择</th>
                <th width="10%">序号</th>
				<th width="10%">姓名</th>
				<th width="10%">出生日期</th>
				<th width="10%">性别</th>
				<th width="10%">国家地区</th>
				<th width="10%">职务职称</th>
				<th width="10%">专业</th>
				<th width="10%">来华次数</th>
				<th width="10%">在华天数</th>
				<%--<th width="10%">最高学位</th>
				<th width="10%" >项目分工 </th>
				<th width="15%">所在单位</th>--%>
			</tr>
		</thead>
		<tbody id="tab">
			<tr style="display: none">
				<td  align="center"  width="50px" >
					<input type="radio" name="sel_zh_persons" />
                    <input type="hidden" name="experts|expert[0]|basic_info|ethnicity_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|ethnicity_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|subject_code" />
                    <input type="hidden" name="experts|expert[0]|basic_info|subject_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|discipline_code" />
                    <input type="hidden" name="experts|expert[0]|basic_info|discipline_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|region_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|region_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|card_type_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|academician_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|academician_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|org_code" />
                    <input type="hidden" name="experts|expert[0]|contact|tel_work" />
                    <input type="hidden" name="experts|expert[0]|contact|fax" />
                    <input type="hidden" name="experts|expert[0]|basic_info|post_code" />
                    <input type="hidden" name="experts|expert[0]|basic_info|degree_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|degree_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|degree_country_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|degree_country_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|degree_college" />
                    <input type="hidden" name="experts|expert[0]|basic_info|degree_year" />
                    <input type="hidden" name="experts|expert[0]|basic_info|address" />
                    <input type="hidden" name="experts|expert[0]|basic_info|prof_title" />
                    <input type="hidden" name="experts|expert[0]|basic_info|prof_title_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|gender" />
                    <input type="hidden" name="experts|expert[0]|basic_info|gender_value" />
                    <input type="hidden" name="experts|expert[0]|basic_info|post_doctor_value"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|post_doctor_name"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|birth_date"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|position"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|age"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|educate_value"/>
                    <input type="hidden" name="experts|expert[0]|iscomember" value="0"/>
                    <input type="hidden" name="experts|expert[0]|researches" label="xml"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|card_type_name" />
                    <input type="hidden" name="experts|expert[0]|basic_info|card_code"/>
                    <input type="hidden" name="experts|expert[0]|contact|email"/>
                    <input type="hidden" name="experts|expert[0]|contact|mobile"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|org_name"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|tech_department_address"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|subordinate_expert_organizations"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|start_end_date"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary9"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary9_hidden"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary10"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary10_hidden"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary11"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary11_hidden"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary12"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|summary12_hidden"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|work_date"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|nationality_travel_expenses"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|hotel_expense"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|transportation_charges"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|expert_subsidies"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|expert_living_expenses"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|lecture_fees"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|petty_cash"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|contract_agreed_amount"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|apply_for_subsidy"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|subtotal"/>
                    <input type="hidden" name="experts|expert[0]|basic_info|file_code8"/>
                </td>
				<td align="center">
					<span name="experts|expert[0]@seq_no">[index]</span>
				</td>
				<td align="center">
					<span name="experts|expert[0]|basic_info|zh_name"></span>
				</td>
				<td align="center">
					<span name="experts|expert[0]|basic_info|birthday"></span>
				</td>
				<td align="center">
					<span name="experts|expert[0]|basic_info|gender_name"></span>
				</td>
				<td align="center">
					<span name="experts|expert[0]|basic_info|region_name" ></span>
				</td>
				<td align="center">
					<span name="experts|expert[0]|basic_info|prof_title_name" ></span>
				</td>
				<td align="left">
					<span name="experts|expert[0]|contact|major_work"></span>
				</td>

				<td align="center">
					<span name="experts|expert[0]|basic_info|number_of_visits"></span>
				</td>
				<td align="center">
					<span name="experts|expert[0]|basic_info|days_to_china"></span>
				</td>
			</tr>
			<c:set value="0" var="index" scope="page" />
			<x:forEach select="$xmlData/data/experts/expert" var="expert">
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr>
					<td  align="center"  width="50px" >
						<input type="radio" name="sel_zh_persons" />
					</td>
					<td align="center">
					<span name="experts/expert[${flag}${index}]@seq_no"><x:out select="$expert/@seq_no" /></span>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/gender" value="<x:out select="$expert/basic_info/gender" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/gender_value" value="<x:out select="$expert/basic_info/gender_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/gender_name" value="<x:out select="$expert/basic_info/gender_name" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/en_name" value="<x:out select="$expert/basic_info/en_name" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/ethnicity_value" value="<x:out select="$expert/basic_info/ethnicity_value" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/ethnicity_name" value="<x:out select="$expert/basic_info/ethnicity_name" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/subject_code" value="<x:out select="$expert/basic_info/subject_code" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/subject_name" value="<x:out select="$expert/basic_info/subject_name" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/discipline_code" value="<x:out select="$expert/basic_info/discipline_code" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/discipline_name" value="<x:out select="$expert/basic_info/discipline_name" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/region_value" value="<x:out select="$expert/basic_info/region_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/region_name" value="<x:out select="$expert/basic_info/region_name" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/card_type_value" value="<x:out select="$expert/basic_info/card_type_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/academician_value" value="<x:out select="$expert/basic_info/academician_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/academician_name" value="<x:out select="$expert/basic_info/academician_name" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/org_code" value="<x:out select="$expert/basic_info/org_code" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/contact/tel_work" value="<x:out select="$expert/contact/tel_work" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/contact/fax" value="<x:out select="$expert/contact/fax" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/degree_value" value="<x:out select="$expert/basic_info/degree_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/degree_name" value="<x:out select="$expert/basic_info/degree_name" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/post_code" value="<x:out select="$expert/basic_info/post_code" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/degree_country_value" value="<x:out select="$expert/basic_info/degree_country_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/degree_country_name" value="<x:out select="$expert/basic_info/degree_country_name" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/degree_college" value="<x:out select="$expert/basic_info/degree_college" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/degree_year" value="<x:out select="$expert/basic_info/degree_year" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/position" value="<x:out select="$expert/basic_info/position" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/gender" value="<x:out select="$expert/basic_info/gender" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/gender_value" value="<x:out select="$expert/basic_info/gender_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/prof_title" value="<x:out select="$expert/basic_info/prof_title" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/prof_title_value" value="<x:out select="$expert/basic_info/prof_title_value" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/address" value="<x:out select="$expert/basic_info/address" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/post_doctor_value" value="<x:out select="$expert/basic_info/post_doctor_value" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/post_doctor_name" value="<x:out select="$expert/basic_info/post_doctor_name" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/age" value="<x:out select="$expert/basic_info/age" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/educate_value" value="<x:out select="$expert/basic_info/educate_value" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/card_code" value="<x:out select="$expert/basic_info/card_code" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/card_type_name" value="<x:out select="$expert/basic_info/card_type_name" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/org_name" value="<x:out select="$expert/basic_info/org_name" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/tech_department_address" value="<x:out select="$expert/basic_info/tech_department_address" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/subordinate_expert_organizations" value="<x:out select="$expert/basic_info/subordinate_expert_organizations" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/start_end_date" value="<x:out select="$expert/basic_info/start_end_date" />"/>
                       <%-- <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary9" value="<x:out select="$expert/basic_info/summary9" />"/>--%>
                        <textarea  class="input_textarea required  maxlength:300" style="display: none"  name="experts/expert[${flag}${index}]/basic_info/summary9"  value="<x:out select="$expert/basic_info/summary9" />"></textarea>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary9_hidden" value="<x:out select="$expert/basic_info/summary9_hidden" />"/>
                        <%--<input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary10" value="<x:out select="$expert/basic_info/summary10" />"/>--%>
                        <textarea  class="input_textarea required  maxlength:300" style="display: none"  name="experts/expert[${flag}${index}]/basic_info/summary10"  value="<x:out select="$expert/basic_info/summary10" />"></textarea>

                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary10_hidden" value="<x:out select="$expert/basic_info/summary10_hidden" />"/>
                       <%-- <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary11" value="<x:out select="$expert/basic_info/summary11" />"/>--%>
                        <textarea  class="input_textarea required  maxlength:300" style="display: none"  name="experts/expert[${flag}${index}]/basic_info/summary11"  value="<x:out select="$expert/basic_info/summary11" />"></textarea>

                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary11_hidden" value="<x:out select="$expert/basic_info/summary11_hidden" />"/>
                       <%-- <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary12" value="<x:out select="$expert/basic_info/summary12" />"/>--%>
                        <textarea  class="input_textarea required  maxlength:300" style="display: none"  name="experts/expert[${flag}${index}]/basic_info/summary12"  value="<x:out select="$expert/basic_info/summary12" />"></textarea>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/summary12_hidden" value="<x:out select="$expert/basic_info/summary12_hidden" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/contact/email" value="<x:out select="$expert/contact/email" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/contact/mobile" value="<x:out select="$expert/contact/mobile" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/iscomember" value="0"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/researches" label="xml"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/work_date" value="<x:out select="$expert/basic_info/work_date" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/nationality_travel_expenses" value="<x:out select="$expert/basic_info/nationality_travel_expenses" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/hotel_expense" value="<x:out select="$expert/basic_info/hotel_expense" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/transportation_charges" value="<x:out select="$expert/basic_info/transportation_charges" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/expert_subsidies" value="<x:out select="$expert/basic_info/expert_subsidies" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/expert_living_expenses" value="<x:out select="$expert/basic_info/expert_living_expenses" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/lecture_fees" value="<x:out select="$expert/basic_info/lecture_fees" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/petty_cash" value="<x:out select="$expert/basic_info/petty_cash" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/contract_agreed_amount" value="<x:out select="$expert/basic_info/contract_agreed_amount" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/apply_for_subsidy" value="<x:out select="$expert/basic_info/apply_for_subsidy" />"/>
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/subtotal" value="<x:out select="$expert/basic_info/subtotal" />" />
                        <input type="hidden" name="experts/expert[${flag}${index}]/basic_info/file_code8" value="<x:out select="$expert/basic_info/file_code8" />" />


                    </td>
					<td align="center">
						<span name="experts/expert[${flag}${index}]/basic_info/zh_name"><x:out select="$expert/basic_info/zh_name" /></span>
					</td>
					<td align="center">
						<span name="experts/expert[${flag}${index}]/basic_info/birthday"><x:out select="$expert/basic_info/birthday" /></span>
					</td>
					<td align="center">
						<span name="experts/expert[${flag}${index}]/basic_info/gender_name"><x:out select="$expert/basic_info/gender_name" /></span>
					</td>
					 <td align="center">
						<span name="experts/expert[${flag}${index}]/basic_info/region_name"><x:out select="$expert/basic_info/region_name" /></span>
					</td>
					  <td align="center">					
						<span name="experts/expert[${flag}${index}]/basic_info/prof_title_name"><x:out select="$expert/basic_info/prof_title_name" /></span>
					</td>
					<td align="left">					
						<span name="experts/expert[${flag}${index}]/contact/major_work"><x:out select="$expert/contact/major_work" /></span>
					</td>
					<td align="center">
						<span name="experts/expert[${flag}${index}]/basic_info/number_of_visits"><x:out select="$expert/basic_info/number_of_visits" /></span>
					</td>
					<td align="center"> 
						<span name="experts/expert[${flag}${index}]/basic_info/days_to_china"><x:out select="$expert/basic_info/days_to_china" /></span>
					</td>

				</tr>
				<c:set value="${index+1}" var="index" scope="page" />
			</x:forEach>
			</tbody>
	</table>
<br>

	<table border="0" cellpadding="0" cellspacing="1">
		<tr>
			<td>
				<input class="button_02" type="button" value="添加" onclick="if(checkTabLimit('experts',7,'专家信息最多只能填写6条')){addNewRow('experts','${ctx}/proposal/edit/dialog/psnInfoEdit_gdyjzj?parentTab=experts&type=add&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','添加专家信息');}try{top.resizeFrame();}catch(e){};attachCheckBuyWay();">
				&nbsp;<input class="button_02"  id="zh_psnPrev" type="button" value="上移" onclick="movePrev('experts');">
				&nbsp;<input class="button_02"  id="zh_psnNext" type="button" value="下移" onclick="moveNext('experts');">
				&nbsp;<input class="button_02"  id="zh_psnEdit" type="button" value="编辑" onclick="editRow('experts','${ctx}/proposal/edit/dialog/psnInfoEdit_gdyjzj?parentTab=experts&type=edit&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=900','编辑专家信息');attachCheckBuyWay();">
				&nbsp;<input class="button_02"  id="zh_psnDel" type="button" value="删除" onclick="deleteSelectedRow('experts','专家信息');attachCheckBuyWay();caculateDayChinaTotal();"></td>
		</tr>
		</tbody>
	</table>


	
<script type="text/javascript">


    $(function() {
        caculateDayChinaTotal();
        attachCheckBuyWay();
        /* 临时办法去除所属学科的属性以及加上要的*/
        /* $("#subject").removeClass();
        $("#subject").removeAttr("disabled");
        $("#subject").attr("readonly","readonly"); */
    });
function selectFirstRadio(obj) {
	$(obj).parent('td').parent('tr').find('input[type="radio"]').attr("checked","checked");
}

function psnSynchro(){
	$("span[name$='fzr_psnname']").text($("#experts tr:eq(2)").find("span[name$='basic_info/zh_name']").text());
	$("span[name$='fzr_tel']").text($("#experts tr:eq(2)").find("input[name$='contact/tel_work']").val());
	$("span[name$='fzr_mobile']").text($("#experts tr:eq(2)").find("input[name$='contact/mobile']").val());
	$("span[name$='fzr_mail']").text($("#experts tr:eq(2)").find("input[name$='contact/email']").val());
}
function attachCheckBuyWay(id) {
    var tab = document.getElementById("experts") ;
    var rows = tab.rows.length-2 ;
    if(rows>0){
        $("#yqjfjs").val(rows);
    }else {
        $("#yqjfjs").val('0');
    }
}

function caculateDayChinaTotal(){
    countCols("experts" ,'days_to_china' ,'yqjfjs1');
}

/**
 * 动态添加行取某一数据进行相加
 *
 * @param id  表id
 * @param colNameSuffix 节点的后缀名
 * @param countId 获取值进行赋值
 * @return void
 * @Author TAOLIU
 * @Date 2019/8/26 0026 15:11
 * @Version V1.0
 */
function countCols(id, colNameSuffix , countId) {
    var tableObj = document.getElementById(id) ;
    var trObj;
    var total = 0;
    var colValue;
    for (var i = tableObj.rows.length - 1; i > 1; i--)
    {
        trObj = tableObj.rows[i];
        colValue = $(trObj).find("span[name$='colNameSuffix']").text();
        if(!!colValue) {
            total += parseInt(colValue);
        }
    }
    $("#" + countId).val(total);
}


</script>